package com.js.nickcar.api;

import com.js.nickcar.entity.remote.ApiResultBean;
import com.js.nickcar.entity.remote.CarBrandBean;
import com.js.nickcar.entity.remote.CarInfoBean;
import com.js.nickcar.entity.remote.CarModelBean;
import com.js.nickcar.entity.remote.CarModelYearBean;
import com.js.nickcar.entity.remote.CarSeriesBean;
import com.js.nickcar.entity.remote.LoginBean;
import com.js.nickcar.entity.remote.OptionBean;
import com.js.nickcar.entity.remote.UploadImageBean;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

import okhttp3.MultipartBody;
import retrofit2.http.Body;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import rx.Observable;

/**
 * Created by LZY on 2017/9/28.
 */

public interface APIService {
    @POST(UrlConfig.API_APPRAISER_LOGIN)
    Observable<ApiResultBean<LoginBean>> login(@Query("phone") String phone,
                                               @Query("code") String code);

    @POST(UrlConfig.API_APPRAISER_CAR_BRAND)
    Observable<ApiResultBean<TreeMap<String, ArrayList<CarBrandBean>>>> getCarBrand(@QueryMap Map<String, String> map);

    @POST(UrlConfig.API_APPRAISER_CAR_SERIES)
    Observable<ApiResultBean<ArrayList<CarSeriesBean>>> getCarSeries(@QueryMap Map<String, String> map);

    @POST(UrlConfig.API_APPRAISER_CAR_MODEL_YEAR)
    Observable<ApiResultBean<ArrayList<CarModelYearBean>>> getCarModelYear(@QueryMap Map<String, String> map);

    @POST(UrlConfig.API_APPRAISER_CAR_MODEL)
    Observable<ApiResultBean<ArrayList<CarModelBean>>> getCarModel(@QueryMap Map<String, String> map);

    @POST(UrlConfig.API_APPRAISER_CAR)
    Observable<ApiResultBean<String>> commitCarBaseInfo(@QueryMap Map<String, String> map);

    @POST(UrlConfig.API_APPRAISER_CAR_CHECK)
    Observable<ApiResultBean<String>> commitCarCheck(@QueryMap Map<String, String> map);

    @POST(UrlConfig.API_COMMON_OPTIONS)
    Observable<ApiResultBean<HashMap<String, ArrayList<OptionBean>>>> getOptions(@QueryMap Map<String, String> map);

    @POST(UrlConfig.API_COMMON_SMSCODE)
    Observable<ApiResultBean> getSmsCode(@Query("phone") String phone);

    @POST(UrlConfig.API_IMAGE_UPLOAD)
    Observable<ApiResultBean<UploadImageBean>> uploadImage(@Body MultipartBody imgs);

    @POST(UrlConfig.API_APPRAISER_CAR_IMAGE)
    Observable<ApiResultBean> commitCarImage(@QueryMap Map<String, String> map);

    @POST(UrlConfig.API_APPRAISER_CAR_PRICE)
    Observable<ApiResultBean> commitCarPrice(@QueryMap Map<String, String> map);

    @POST(UrlConfig.API_APPRAISER_CAR_INFO)
    Observable<ApiResultBean<CarInfoBean>> getCarInfo(@QueryMap Map<String, String> map);
}
